package classfile

type ExceptionsAttribute struct {
	attribute_name_index  uint16
	attribute_length      uint32
	number_of_exceptions  uint16
	exception_index_table []uint16
}

func (self *ExceptionsAttribute) readInfo(reader *ClassReader) {
	//self.attribute_name_index = reader.readUint16()
	//self.attribute_length = reader.readUint32()
	self.number_of_exceptions = reader.readUint16()
	self.exception_index_table = readExceptionIndexTable(self.number_of_exceptions, reader)
}

func readExceptionIndexTable(count uint16, reader *ClassReader) []uint16 {
	ret := make([]uint16, count)
	for i := range ret {
		ret[i] = reader.readUint16()
	}
	return ret
}
